﻿using System.Data;
using MigSharp;

namespace CmsDatabaseMigrations.Migrations
{
    [MigrationExport(ModuleName = "Adds AdminCaption to PageControls table", Tag = "Module")]
    public class PageControlsAddAdminCaption201206301323 : IReversibleMigration
    {
        private const string AdminCaption = "AdminCaption";        
        public void Up(IDatabase db)
        {
            db.Tables["PageControls"].AddNullableColumn(AdminCaption, DbType.String).OfSize(255);            
        }

        public void Down(IDatabase db)
        {
            db.Tables["PageControls"].Columns[AdminCaption].Drop();            
        }
    }
}